import pandas as pd


a = pd.date_range(start="20171230", end="20180131", freq="D")
print("--1--" * 6)
print(a)
print("--2--" * 6)
print(pd.date_range(start="20171230", end="20180131", freq="10D")) # 每隔10天
print("--3--" * 6)
print(pd.date_range(start="20171230", periods=10, freq="D"))
print("--4--" * 6)
print(pd.date_range(start="20171230", periods=10, freq="M"))  # 月份
print("--5--" * 6)
print(pd.date_range(start="20171230", periods=10, freq="H"))  # 月份
print("--6--" * 6)
print(pd.date_range(start="2017-12-30 10:10:30", periods=10, freq="H"))  # 月份